// pages/category/index.ts
import ur from "../../utils/extendApi"

Page({

  /**
   * 页面的初始数据
   */
  data: {
    toView: "hello",
    activeTopIndex: 0,
    activeLeftIndex: 0,
    category: [{
      name: '热销推荐',
      code: '男装',
      list: [{
        name: '每周新品',
        code: '上衣',
        list: [
          {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          },
          {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          },
          {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            title: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          },
        ]
      }, {
        name: '新品精选',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '风格趋势',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '春日调色盘',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '爆款特辑',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '商场同款',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '极简基础',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }, {
          name: '外套',
          code: '上衣',
          list: [{
            name: '羊毛衫',
            code: '羊毛衫',
          },
          {
            name: '羊毛衫',
            code: '羊毛衫',
          }]
        }]
      }]
    },
    {
      name: '潮流特辑',
      code: '男装',
      list: [{
        name: '每周新品',
        code: '上衣',
        list: [
          {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          },
          {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          },
          {
            title: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            title: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          }, {
            name: '标题文字',
            icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ',
          },
        ]
      }, {
        name: '新品精选',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '风格趋势',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '春日调色盘',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '爆款特辑',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '商场同款',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '极简基础',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }, {
          name: '外套',
          code: '上衣',
          list: [{
            name: '羊毛衫',
            code: '羊毛衫',
          },
          {
            name: '羊毛衫',
            code: '羊毛衫',
          }]
        }]
      }]
    },
    {
      name: '女士',
      code: 'nushi',
      list: [{
        name: '连衣裙',
        code: 'lianyiqun',
        list: [{
          name: '全部',
          code: 'quanbu',
        },
        {
          name: '短裙',
          code: 'duanqun',
        },
        {
          name: '中长裙/长裙',
          code: 'zhongchangqun-changqun',
        },
        {
          name: '无袖/吊带裙',
          code: 'wuxiu-diaodaiqun',
        },
        {
          name: '印花连衣裙',
          code: 'yinhualianyiqun',
        },
        {
          name: '衬衫式连衣裙',
          code: 'chenshanshilianyiqun',
        }]
      }, {
        name: '衬衫',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: 'T恤',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '半身裙',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '丹宁',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '裤子',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }, {
        name: '针织',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }, {
          name: '外套',
          code: '上衣',
          list: [{
            name: '羊毛衫',
            code: '羊毛衫',
          },
          {
            name: '羊毛衫',
            code: '羊毛衫',
          }]
        }]
      }]
    },
    {
      name: '男士',
      code: '男装',
      list: [{
        name: '上衣',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }]
    },
    {
      name: '鞋包配饰',
      code: '男装',
      list: [{
        name: '上衣',
        code: '上衣',
        list: [{
          name: '羊毛衫',
          code: '羊毛衫',
        },
        {
          name: '羊毛衫',
          code: '羊毛衫',
        }]
      }]
    }],

  },

  onActiveTop(e: any) {
    this.setData({
      activeTopIndex: e.currentTarget.dataset['index'],
      activeLeftIndex: 0,
      toView: 'hello'
    })
  },

  onActiveLeft(e: any) {
    this.setData({
      activeLeftIndex: e.currentTarget.dataset['index'],
      toView: 'hello'
    })
  },

  onGoGoodList(e: any) {
    
    wx.navigateTo({
      url: '/pages/goodList/index'
    })
    ur.setStorageApi("currentmenulist", e.currentTarget.dataset['currentmenulist'])
    ur.setStorageApi("currentmenuitem", e.currentTarget.dataset['currentmenuitem'])


  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },
  
})

